Email XML attachment
The email XML attachment is used to collect various properties of the letter that are required to send the letter as an attachment to an email message.
Schema
<mkzAttachment type="email">
<onSubmit>
<emailSubject [scan|identifier] >subj</emailSubject>
<emailTo [scan|identifier] >recipient</emailTo>
<emailFrom [scan|identifier] >sender</emailFrom>
<emailCc [scan|identifier] >recipient</emailCc>
<emailBody [scan|identifier] >text</emailBody>
<emailBodyFolder [scan|identifier] >pathname</emailBodyFolder>
<emailBodyFile [scan|identifier] >filename</emailBodyFile>
<emailAttachmentName [scan|identifier] >name</emailAttachmentName>
<emailReplyTo [scan|identifier] >recipient</emailReplyTo>
<useNHSSecureEmail [scan|identifier] >boolean</useNHSSecureEmail>
<smsTo [scan|identifier] provider="name">recipient</smsTo>
<smsFrom [scan|identifier] >sender</smsFrom>
<smsBody [scan|identifier] >text</smsBody>
<smsBodyFile [scan|identifier] >filename</smsBodyFile>
<substitute [scan|identifier] subKey="@name@"></substitute>
</onSubmit>
<onRelease>
<sendEmail attachLetter="boolean"/>
<sendSms/>
</onRelease>
</mkzAttachment>
The XML can be executed during the OnSubmit and OnRelease phases.
The OnRelease section is only relevant when the email attachment is being called from a ‘paper’ output as it is released. There is no OnRelease section for an email output because the email is sent as soon as the letter arrives in the queue.
The XML supports the following elements during OnSubmit.
<emailSubject> Set email subject.
This element defines the subject of the email. There may be multiple instances of this element, in which case the elements are concatenated with a space character between each one.
<emailTo> Set email recipient(s).
This element defines the recipient of the email. There may be multiple instances of this element, in which case the elements are concatenated with a semi-colon character between each one.
<emailFrom> Set email sender.
This element defines the sender of the email. If this element is not specified, then the sender is defined by the Organisation settings and the 'EmailType' database table.
<emailCc> Set email copy recipient(s).
This element defines the copy recipient of the email. There may be multiple instances of this element, in which case the elements are concatenated with a semi-colon character between each one.
<emailBody> Set email body text.
This element defines the body recipient of the email. There may be multiple instances of this element, in which case the elements are concatenated with a space character between each one.
N.B. This element is ignored if the email body text is being defined by an <emailBodyFile> element.
<emailBodyFolder> Set the folder where email body files are stored.
This element defines the path where email body files are stored. If the <emailBodyFile> element does not specify a rooted path, then the filename is concatenated with this path to form the full filename.
<emailBodyFile> Set the file containing the email body text.
This element defines the filename of the email body. If this path is not rooted, then it will be concatenated with the <emailBodyFolder> element.
<emailAttachmentName>
This element defines the name that the attachment will be given for the instances where the PDF letter is included as an attachment to the email.
<emailReplyTo>
This element defines the recipient to which a reply will be sent when the user click ‘Reply’ in the email client program. Only a single instance of this element is allowed. If there is more than one instance, only the last one will be used.
<useNHSSecureEmail>boolean</useNHSSecureEmail>
This element causes the email to be sent using the NHS secure mail server (entry 2 in the EmailType database table).
<smsTo provider="name"/>
This element defines the recipient of the SMS (i.e. the mobile phone number). There may be multiple instances of this element, in which case the elements are concatenated with a semi-colon between each one. The default SMS provider is txtlocal.
<smsFrom> Set SMS sender.
This element defines the sender of the SMS. If this element is not specified, then the sender is defined by the Organisation settings and the 'EmailType' database table.
<smsBody> Set email body text.
This element defines the body recipient of the SMS. There may be multiple instances of this element, in which case the elements are concatenated with a space character between each one. This element is ignored if the email body text is being defined by an <smsBodyFile> element..
<smsBodyFile> Set the file containing the SMS body text.
This element defines the filename of the SMS body. If this path is not rooted, then it will be concatenated with the <emailBodyFolder> element.
<substitute subKey="name"/>value</substitute>
These elements define the values that can be used to replace all instances of names in the body text of the email and/or the SMS messages. E.g. If:
| Email/SMS body | You have an appointment on @APPT_DATE@. |
| XML element | <substitute subKey="@appt_date@" scan="50,40,30,10" /> |
| Scanned text from “50,40,30,10” | 14th June 2019 |
| Resulting text in email/SMS body | You have an appointment on 14th June 2019 |
The XML supports the following elements during OnRelease.
<sendEmail attachLetter="boolean"/>
This element causes an email to be sent with the recipient, subject and body defined above. If the attachLetter attribute is true, then the PDF letter file will be added as an attachment to the email.
<sendSms/>
This element causes an SMS message to be sent with the recipient, subject and body defined above.